package com.ld.security.auth.common.base.entity;

import com.ld.security.auth.common.base.constants.JwtUserConstant;
import com.ld.security.common.mybatis.anno.ManyToMany;
import com.ld.security.common.mybatis.anno.ManyToOne;
import com.ld.security.common.mybatis.anno.OneToMany;
import com.ld.security.common.mybatis.anno.OneToOne;
import com.ld.security.common.shiro.vo.UserInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Map;

@ApiModel("登录模型")
@Data
public class JwtUserInfo implements UserInfo {

    private JwtUser user;

    @ManyToOne("user.roleIds")
    private List<JwtRole> roles;

    @ManyToMany("roles.permissionIds")
    private List<JwtPermission> permissions;

    @ManyToMany("roles.managerDeptIds")
    private List<JwtScope> deptScope;

    @ManyToMany("roles.managerUserIds")
    private List<JwtScope> scopeUser;

    @OneToOne("user.crtDept")
    private JwtDept dept;

    private Map<String,Object> jwtViews;

}
